package com.comprehensive.personalfile.util;

import java.net.InetAddress;
import java.net.UnknownHostException;
public class IpUtil {
    public static String getLocalIp() {
        String ip ="127.0.0.1";
        try {
            ip = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
        }
        return ip;
    }

    public static void main(String[] args) {
        System.out.println(IpUtil.getLocalIp());
    }
}